﻿using System;
using System.Collections.Generic;
using System.Text;
using EShop.Common;
using EShop.DAL;
using System.Data;

namespace EShop.BLL
{
    public class MerchandiseBindBLL
    {
        MerchandiseBindDAL oMerchandiseBindDAL = new MerchandiseBindDAL();

        public bool MerchandiseBindAppend(string BindName, int MerchandiseUnitID, decimal SellPrice)
        {
            return oMerchandiseBindDAL.MerchandiseBindAppend(BindName, MerchandiseUnitID, SellPrice) > 0 ? true : false;
        }

        public bool MerchandiseBindDetailAppend(string BindID, string Barcode, int Quantity)
        {
            return oMerchandiseBindDAL.MerchandiseBindDetailAppend(BindID,Barcode, Quantity) > 0 ? true : false;
        }

        public DataTable MerchandiseBindQuery(string BindID)
        {
            return oMerchandiseBindDAL.MerchandiseBindQuery(BindID);
        }

        public DataTable MerchandiseBindDetailQuery(string BindID, string Barcode)
        {
            return oMerchandiseBindDAL.MerchandiseBindDetailQuery(BindID, Barcode);
        }

        public bool MerchandiseBindDelete(string BindID)
        {
            return oMerchandiseBindDAL.MerchandiseBindDelete(BindID) > 0 ? true : false;
        }

        public bool MerchandiseBindDetailDelete(string BindID, string Barcode)
        {
            return oMerchandiseBindDAL.MerchandiseBindDetailDelete(BindID, Barcode) > 0 ? true : false;
        }

        public bool MerchandiseBindUpdate(string BindID, string BindName, int MerchandiseUnitID, decimal SellPrice)
        {
            return oMerchandiseBindDAL.MerchandiseBindUpdate(BindID, BindName, MerchandiseUnitID, SellPrice) > 0 ? true : false;
        }
    }
}
